import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import IndexView from '../views/IndexView.vue'
import GoodsView from '../views/GoodsView.vue'
import GoodsDetailView from '../views/GoodsDetailView.vue'
import MynavView from '../views/MynavView.vue'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'
import HelpView from '../views/HelpView.vue'
import ShimingView from '../views/ShimingView.vue'
import JiaoyiView from '../views/JiaoyiView.vue'
import SellroleView from '../views/SellroleView.vue'
import BindView from '../views/BindView.vue'
import SellView from '../views/SellView.vue'
import SetorderView from '../views/SetorderView.vue'
import UserIndexView from '../views/UserIndexView.vue'
import AccountView from '../views/AccountView.vue'
import CollectView from '../views/CollectView.vue'
import PayView from '../views/PayView.vue'
import OrderView from '../views/OrderView.vue'
import ChangePwdView from '../views/ChangePwdView.vue'
import FooterView from '../views/FooterView.vue'
import AppView from '../views/AppView.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '/',
    components:{
      default:IndexView,
      'headnav':MynavView,
      'footer':FooterView,
    }
  },
  {
    path: '/index',
    name: 'index',
    components:{
      default:IndexView,
      'headnav':MynavView,
      'footer':FooterView,
    }
  },
  {
    path: '/goods',
    name: 'goods',
    components:{
      default:GoodsView,
      'headnav':MynavView,
      'footer':FooterView,
    }
  },
  {
    path: '/detail',
    name: 'detail',
    components: {
      default:GoodsDetailView,
      'headnav':MynavView
    }
  },
  {
      path: '/setorder',
      name: 'setorder',
      component:SetorderView
  },
  {
    path: '/pay',
    name: 'pay',
    component:PayView
},
{
  path: '/app',
  name: 'app',
  component:AppView
},
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'login',
    components:{
      default:LoginView,
      'headnav':null
    }
  },
  {
    path: '/changePwd',
    name: 'changePwd',
    components:{
    default:ChangePwdView,
    'headnav':null
    }
  },
  {
    path: '/register',
    name: 'register',
    components:{
      default:RegisterView,
      'headnav':null
    }
  },
  {
    path: '/help',
    name: 'help',
    components:{
      default:HelpView,
      'headnav':MynavView,
      'footer':FooterView,
    },
    children:[
      {path:'shiming',name:'shiming',component:ShimingView},
      {path:'jiaoyi',name:'jiaoyi',component:JiaoyiView},
      {path:'sellrule',name:'sellrule',component:SellroleView},
      {path:'bind',name:'bind',component:BindView},
      {path:'sell',name:'sell',component:SellView},
    ]
  },
  {
    path: '/userindex',
    name: 'userindex',
    components:{
      default:UserIndexView,
      'headnav':MynavView,
      'footer':FooterView,
    },
    children:[
      {path:'account',name:'account',component:AccountView},
      {path:'order',name:'order',component:OrderView},
      {path:'collect',name:'collect',component:CollectView},
    ]
  },
  {
    path: '/Footer',
    component: () => import('@/views/FooterView')
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
